<?php $this->_extends('_layouts/default_layout'); ?>

<?php $this->_block('title'); ?>Rising<?php $this->_endblock(); ?>
<?php $this->_block('body_id'); ?>portfolio<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
	<div id="wrap">
		<?php $this->_element('header'); ?>
		
		<?php 
			$this->_element('breadcrumbs', array(
				'crumbs' => array(
					'HTML模板' => ''
				)
			)); 
		?>
		
		<div id="content" role="main">
			<hgroup id="page-title">
				<h1>HTML模板</h1>
				<h2>Get yourself inspired with our work</h2>
			</hgroup>
			
			<div class="column-grid special cols-3 clearfix">
				<?php $threeCols = dataUtil::sliceArrayColumn($htmlTemplates, 3); ?>
				<ul class="column nostyle entry">
					<li>
						<form class="htmltemp_rec" accept-charset="utf-8" method="get" action="#">
					        <?php if(!empty($typeAreas)):?>
				        		<div>
						        	<?php foreach($typeAreas as $k => $area): ?>
							        	<?php $currChecked = ((!empty($filter['type_area_id'])) && in_array($area['id'], $filter['type_area_id']))? true : false; ?>
							        	<label class="label_check">
										    <input name="filter[type_area_id][<?php echo $k; ?>]" value="<?php echo $area['id']; ?>" type="checkbox" <?php echo $currChecked? 'checked="checked"' : ''; ?> />
										    <?php echo $area['name']; ?>
										</label> 
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					        
				        	<?php if(!empty($typeColors)):?>
				        		<div class="topBorder">
						        	<?php foreach($typeColors as $k => $color): ?>
							        	<?php $currChecked = (!empty($filter['type_color_id']) && in_array($color['id'], $filter['type_color_id']))? true : false; ?>
							        	<label class="label_check">
										    <input name="filter[type_color_id][<?php echo $k; ?>]" value="<?php echo $color['id']; ?>" type="checkbox" <?php echo $currChecked? 'checked="checked"' : ''; ?> />
										    <?php echo $color['name']; ?>
										</label> 
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					        
				        	<?php if(!empty($typeColumnWidths)):?>
				        		<div class="topBorder">
						        	<?php foreach($typeColumnWidths as $k => $cw): ?>
						        		<?php $currChecked = (!empty($filter['type_columnwidth_id']) && in_array($cw['id'], $filter['type_columnwidth_id']))? true : false; ?>
							        	<label class="label_check">
										    <input name="filter[type_columnwidth_id][<?php echo $k; ?>]" value="<?php echo $cw['id']; ?>" type="checkbox" <?php echo $currChecked? 'checked="checked"' : ''; ?> />
										    <?php echo $cw['name']; ?>
										</label> 
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					        
				        	<?php if(!empty($typeSidebarCorners)):?>
				        		<div class="topBorder">
						        	<?php foreach($typeSidebarCorners as $k => $sc): ?>
						        		<?php $currChecked = (!empty($filter['type_sidebarcorner_id']) && in_array($sc['id'], $filter['type_sidebarcorner_id']))? true : false; ?>
							        	<label class="label_check">
										    <input name="filter[type_sidebarcorner_id][<?php echo $k; ?>]" value="<?php echo $sc['id']; ?>" type="checkbox" <?php echo $currChecked? 'checked="checked"' : ''; ?> />
										    <?php echo $sc['name']; ?>
										</label> 
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					        
				        	<?php if(!empty($typeUsings)):?>
				        		<div class="topBorder">
						        	<?php foreach($typeUsings as $k => $using): ?>
						        		<?php $currChecked = (!empty($filter['type_using_id']) && in_array($using['id'], $filter['type_using_id']))? true : false; ?>
							        	<label class="label_check">
										    <input name="filter[type_using_id][<?php echo $k; ?>]" value="<?php echo $using['id']; ?>" type="checkbox" <?php echo $currChecked? 'checked="checked"' : ''; ?> />
										    <?php echo $using['name']; ?>
										</label> 
									<?php endforeach; ?>
								</div>
							<?php endif; ?>
					        
					        <div class="topBorder bottomSpace">
					        	<input type="submit" value="过滤搜索">
					        </div>
					    </form>
					</li>
					<?php if(!empty($threeCols[2])): foreach($threeCols[2] as $ht): ?>
						<li class="entry">
							<div class="frame">
								<a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>">
									<img alt="<?php echo $ht['name']; ?>" width="278" height="142" src="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_small']; ?>" />
									<span class="overlay"></span>
								</a>
								<a data-lightbox="image" class="plus" href="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_big']; ?>"></a>
							</div>
							<div class="content">
								<div class="wrap">
									<h2 class="post-title"><a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>"><?php echo $ht['name']; ?></a></h2>
									<p><?php echo $ht['description']; ?></p>
								</div>
							</div>
						</li>
					<?php endforeach; endif; ?>
				</ul>
			
				<ul class="column nostyle entry">
					<?php if(!empty($threeCols[0])): foreach($threeCols[0] as $ht): ?>
						<li class="entry">
							<div class="frame">
								<a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>">
									<img alt="<?php echo $ht['name']; ?>" width="278" height="142" src="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_small']; ?>" />
									<span class="overlay"></span>
								</a>
								<a data-lightbox="image" class="plus" href="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_big']; ?>"></a>
							</div>
							<div class="content">
								<div class="wrap">
									<h2 class="post-title"><a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>"><?php echo $ht['name']; ?></a></h2>
									<p><?php echo $ht['description']; ?></p>
								</div>
							</div>
						</li>
					<?php endforeach; endif; ?>
				</ul>
			
				<ul class="column nostyle entry">
					<?php if(!empty($threeCols[1])): foreach($threeCols[1] as $ht): ?>
						<li class="entry">
							<div class="frame">
								<a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>">
									<img alt="<?php echo $ht['name']; ?>" width="278" height="142" src="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_small']; ?>" />
									<span class="overlay"></span>
								</a>
								<a data-lightbox="image" class="plus" href="<?php echo $htmltemp_url . $ht['root_foldername'] . '/' . $ht['thumb_big']; ?>"></a>
							</div>
							<div class="content">
								<div class="wrap">
									<h2 class="post-title"><a href="<?php echo url('htmltemplate/detail', array('id'=> $ht['id'])); ?>"><?php echo $ht['name']; ?></a></h2>
									<p><?php echo $ht['description']; ?></p>
								</div>
							</div>
						</li>
					<?php endforeach; endif; ?>
				</ul>
			</div>
	        <script>
				$('.label_check').labelCheckbox();
	        </script>
			
			<section id="pagination" class="top-dashed-border clearfix">
				<?php echo $pagination; ?>
				<!-- 
				<a class="prev" href="#prev">&laquo; Newer Work</a>
				<a class="next" href="#next">Older Work &raquo;</a>
				 -->
			</section>
		</div>
		
		<?php $this->_element('footer'); ?>
	</div>
<?php $this->_endblock(); ?>

